#include "MiscData.h"
#include <QDataStream>
#include <QFile>
namespace RuntimeData {
MiscData *MiscData::getInstance()
{
    static MiscData singleton{};
    return &singleton;
}

void MiscData::setCrossLine(bool open) {
    QFile file("/home/root/CorssLine.cfg");
    if(file.open(QIODevice::WriteOnly)) {
        QDataStream s(&file);
        s<<open;
        g_miscDataInfo.openCrossLine = open;
        file.close();
    }
}

MiscData::MiscData() {
    QFile file("/home/root/CorssLine.cfg");
    qDebug()<<__FUNCTION__;
    if(file.open(QIODevice::ReadOnly)) {
        QDataStream s(&file);
        s>>g_miscDataInfo.openCrossLine;
        file.close();
    } else {
        setCrossLine(g_miscDataInfo.openCrossLine);
    }
}
}
